package product

import (
	"github.com/gin-gonic/gin"
	"server/middle_ware"
)

func ProductRouter(router *gin.RouterGroup) {

	//获取产品信息列表
	router.GET("/GetProducts", GetProductList)

	//获取产品信息 这里需要token验证
	router.GET("/GoodsDetail", middle_ware.JwtFrontTokenValid, GoodsDetail)

	//实现商品加入购物车
	router.GET("/AddGoodsCar", middle_ware.JwtFrontTokenValid, AddGoodsCar)

	//展示购物车内容
	router.GET("/showGoodsCar", middle_ware.JwtFrontTokenValid, ShowGoodsCar)

	//删除购物车内容
	router.POST("/deleteGoodsCar", middle_ware.JwtFrontTokenValid, DeleteGoodsCar)

	//实现购买
	router.POST("/BuyGoods", middle_ware.JwtFrontTokenValid, BuyGoods)

	//实现购物车购买商品
	router.POST("/BuyByCar", middle_ware.JwtFrontTokenValid, BuyByCar)

	//获取用户购买的订单信息
	router.GET("/GetUserOrder", GetUserOrder)

	//获取用户搜索的关键词
	router.GET("/searchProduct", SearchProduct)

	//获取用户全部的订单信息
	router.GET("/GetOrderList", middle_ware.JwtFrontTokenValid, GetOrderList)

	//进行hash验证
	router.GET("/verify",middle_ware.JwtFrontTokenValid,Verify)
}
